package Book;

public class Book {
    //书的各种属性
    private String Name;
    private String Author;
    private int Prize;
    private String Type;
    private boolean Isborrow;
    //构造方法

    public Book(String name, String author, int prize, String type) {
        Name = name;
        Author = author;
        Prize = prize;
        Type = type;
    }
    //访问字段的方法
    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public String getAuthor() {
        return Author;
    }

    public void setAuthor(String author) {
        Author = author;
    }

    public int getPrize() {
        return Prize;
    }

    public void setPrize(int prize) {
        Prize = prize;
    }

    public String getType() {
        return Type;
    }

    public void setType(String type) {
        Type = type;
    }

    public boolean isIsborrow() {
        return Isborrow;
    }

    public void setIsborrow(boolean isborrow) {
        Isborrow = isborrow;
    }
    //打印书籍信息方法，重写toString方法

    @Override
    public String toString() {
        return "Book.Book{" +
                "Name='" + Name + '\'' +
                ", Author='" + Author + '\'' +
                ", Prize=" + Prize +
                ", Type='" + Type + '\'' +
                ", " + (Isborrow ? "已借阅" : "未借阅") +
                '}';
    }
}
